package com.initial.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.initial.entity.TbCrmContacts;
import com.initial.entity.TbCrmEmailRecord;
import com.initial.entity.TbCrmTask;
import com.initial.mapper.TbCrmContactsMapper;
import com.initial.mapper.TbCrmTaskMapper;
import com.initial.service.TbCrmContactsService;
import com.initial.service.TbCrmTaskService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.sql.Wrapper;
import java.util.List;

/**
* @author 余小年
* @description 针对表【tb_crm_contacts】的数据库操作Service实现
* @createDate 2021-12-14 17:22:00
*/
@Service
public class TbCrmTaskServiceImpl extends ServiceImpl<TbCrmTaskMapper, TbCrmTask>
    implements TbCrmTaskService{
    @Resource
    private TbCrmTaskMapper tbCrmTaskMapper;

    @Override
    public List<TbCrmTask> indexselectAllPage(Integer page, Integer rows, String asd, String subject, Integer ownerUserId, String status) {
        List<TbCrmTask> tbCrmTasks = tbCrmTaskMapper.indexselectAllPage((page-1)*rows, rows, asd, subject, ownerUserId, status);
        return tbCrmTasks;
    }

    @Override
    public List<TbCrmTask> selectAllPage(Integer page,Integer rows,String asd,String subject) {
        List<TbCrmTask> tbCrmEmailRecordIPage = tbCrmTaskMapper.selectAllPage((page-1)*rows,rows,asd,subject);
        return tbCrmEmailRecordIPage;
    }

    @Override
    public Integer deleteByIdInteger(Integer id) {
        Integer integer = tbCrmTaskMapper.deleteByIdInteger(id);
        return integer;
    }

    @Override
    public TbCrmTask selectByIdTbCrmTask(Integer id) {
        TbCrmTask tbCrmTask = tbCrmTaskMapper.selectByIdTbCrmTask(id);
        return tbCrmTask;
    }
}




